package ducna.android.aoeclip.common.model.entity;

import android.os.Parcel;
import android.os.Parcelable;

/**
 * Created by DUCNA on 11/4/2014.
 */
public class Category implements Parcelable {
    private String id;
    private String cateName;
    private String cateIcon;

    public Category(String id, String cateName, String cateIcon) {
        this.id = id;
        this.cateName = cateName;
        this.cateIcon = cateIcon;
    }

    public Category(Parcel in){
        readFromParcel(in);
    }

    /**
     * Called from the constructor to create this object from a parcel.
     *
     * @param in
     *            parcel from which to re-create object
     */
    private void readFromParcel(Parcel in) {
        // We just need to read back each
        // field in the order that it was
        // written to the parcel
        id = in.readString();
        cateName = in.readString();
        cateIcon = in.readString();
    }

    /**
     * Describe the kinds of special objects contained in this Parcelable's
     * marshalled representation.
     *
     * @return a bitmask indicating the set of special object types marshalled
     * by the Parcelable.
     */
    @Override
    public int describeContents() {
        return 0;
    }

    /**
     * Flatten this object in to a Parcel.
     *
     * @param dest  The Parcel in which the object should be written.
     * @param flags Additional flags about how the object should be written.
     *              May be 0 or {@link #PARCELABLE_WRITE_RETURN_VALUE}.
     */
    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeString(id);
        dest.writeString(cateName);
        dest.writeString(cateIcon);
    }

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getCateName() {
        return cateName;
    }

    public void setCateName(String cateName) {
        this.cateName = cateName;
    }

    public String getCateIcon() {
        return cateIcon;
    }

    public void setCateIcon(String cateIcon) {
        this.cateIcon = cateIcon;
    }
}
